package com.ruoyi.cbs.project.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cbs.project.mapper.ProjectEquipmentMapper;
import com.ruoyi.cbs.project.domain.ProjectEquipment;
import com.ruoyi.cbs.project.service.IProjectEquipmentService;

/**
 * 项目器具Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-17
 */
@Service
public class ProjectEquipmentServiceImpl implements IProjectEquipmentService 
{
    @Autowired
    private ProjectEquipmentMapper projectEquipmentMapper;

    /**
     * 查询项目器具
     * 
     * @param id 项目器具主键
     * @return 项目器具
     */
    @Override
    public ProjectEquipment selectProjectEquipmentById(Long id)
    {
        return projectEquipmentMapper.selectProjectEquipmentById(id);
    }

    /**
     * 查询项目器具列表
     * 
     * @param projectEquipment 项目器具
     * @return 项目器具
     */
    @Override
    public List<ProjectEquipment> selectProjectEquipmentList(ProjectEquipment projectEquipment)
    {
        return projectEquipmentMapper.selectProjectEquipmentList(projectEquipment);
    }

    /**
     * 新增项目器具
     * 
     * @param projectEquipment 项目器具
     * @return 结果
     */
    @Override
    public int insertProjectEquipment(ProjectEquipment projectEquipment)
    {
        projectEquipment.setCreateTime(DateUtils.getNowDate());
        return projectEquipmentMapper.insertProjectEquipment(projectEquipment);
    }

    /**
     * 修改项目器具
     * 
     * @param projectEquipment 项目器具
     * @return 结果
     */
    @Override
    public int updateProjectEquipment(ProjectEquipment projectEquipment)
    {
        projectEquipment.setUpdateTime(DateUtils.getNowDate());
        return projectEquipmentMapper.updateProjectEquipment(projectEquipment);
    }

    /**
     * 批量删除项目器具
     * 
     * @param ids 需要删除的项目器具主键
     * @return 结果
     */
    @Override
    public int deleteProjectEquipmentByIds(Long[] ids)
    {
        return projectEquipmentMapper.deleteProjectEquipmentByIds(ids);
    }

    /**
     * 删除项目器具信息
     * 
     * @param id 项目器具主键
     * @return 结果
     */
    @Override
    public int deleteProjectEquipmentById(Long id)
    {
        return projectEquipmentMapper.deleteProjectEquipmentById(id);
    }
}
